<template>
  <svg aria-hidden="true" class="svg-icon">
    <use :xlink:href="symbolId" :fill="color" />
  </svg>
</template>

<script lang="ts" setup>
interface IProps {
  name: string
  size?: string
  color?: string
}

const props = withDefaults(defineProps<IProps>(), {
  name: '',
  color: 'inherit',
  size: '16px'
})

const symbolId = computed(() => `#icon-${props.name}`)
</script>
<style scope lang="scss">
.svg-icon {
  fill: currentcolor;
  outline: none;
  width: v-bind('$props.size');
  height: v-bind('$props.size');
  color: v-bind('$props.color');
}
</style>
